    <!--- search --->
    <div class="main_width" id="home_search">
        <?php echo $this->element('search_home'); ?>
    </div>
    <!--- end search -->
    <?php echo $this->element('unslider')?>
<!----------------------------- body ---------------------------------------->
<div id="h_main" class="main_width">
   
    
    
    <!----- feature ---->
    <div id="h_feature">
        <div id="title_fearture">
            <span><?php echo __('Featured Properties');?></span>
        </div>
        <div>
            <div id="feature_big_image" class="pull-left">
                <div id="feature_big_detail">
                    <?php if(is_array($feature_product) && count($feature_product) > 1):?>
                
                    <a href="<?php echo $this->Html->url('/home/productview/'.$feature_product[0]['product']['product_id']);?>"><img src="<?php echo $this->webroot . $base_config_url . $feature_product[0]['product']['image'] ?>" /></a>
                    <!--<ul class="h_container_icon">
                        <li class="h_area">12 m2</li>
                        <li class="h_beds">3 beds</li>
                        <li class="h_baths">4 baths</li>
                        <div class="clearBoth" ></div>
                    </ul>-->
                    <p>
                    <a href="<?php echo $this->Html->url('/home/productview/'.$feature_product[0]['product']['product_id']);?>"><h5><?php echo $feature_product[0]['product_language']['name'];?></h5></a>
                    <span class="h_price">$ <?php echo $feature_product[0]['product']['price'];?> </span>in <span class="h_location">Ciputra Hanoi Intenational City</span>
                    <?php unset($feature_product[0])?>
                    <?php endif;?>
                </div>
            </div>
            <ul id="list_feature" class="pull-right">
                <?php foreach($feature_product as $value):?>
                <li data-placement="top" data-trigger="hover">
                    <a href="<?php echo $this->Html->url('/home/productview/'.$value['product']['product_id']);?>" >
                        <img src="<?php echo $this->webroot . $base_config_url . $value['product']['image'] ?>" />
                    </a>
                    <div class="title_popover">
                        <div class="width_title_popover"><?php echo $value['product_language']['name'];?></div>
                    </div>
                    <div class="content_popover">
                        <?php echo $this->Custom->descriptionProduct($value['product_language']['description']) ?>
                    </div>
                </li>
                <?php endforeach; ?>
                <div class="clearBoth"></div>
            </ul>
            <div class="clearBoth"></div>
        </div>
    </div>
    <!----- end feature ---->
    <div class="h_container_list">
        <div id="title_fearture">
            <span><?php echo __('Latest Properties');?></span>
        </div>
        <!-- BEGIN products in TPHCM -->
        
        <?php if(isset($Product_Home_HCM) && count($Product_Home_HCM) >= 1 ) echo  "<h4> ".__('Ho Chi Minh City')." </h4>";?>
        <ul class="h_list_product" id="list_product_hcm">
            <?php foreach($Product_Home_HCM as $value):?>
				<?php echo $this->element('product_items', array('value'=>$value))?>
            <?php endforeach; ?>
        </ul>
        <div class="clearBoth"></div>
        <?php if(isset($Product_Home_HCM) && is_array($Product_Home_HCM) && count($Product_Home_HCM) >= 1) echo  '<a id="view_more" style="font-size: 18px;color: #4895B9;cursor: pointer;float: right;">'.__('See more').'</a>';?>
        
        <div class="clearBoth"></div>
        <!-- END products in TPHCM -->
        <!-- BEGIN products in HANOI -->
        <?php if(isset($Product_Home_HN) && is_array($Product_Home_HN) && count($Product_Home_HN) >= 1) echo  "<h4> "._('Ha Noi')." </h4>";?>
        <ul class="h_list_product" id="list_product_hn">
            <?php foreach($Product_Home_HN as $value):?>
				<?php echo $this->element('product_items', array('value'=>$value))?>
            <?php endforeach; ?>
            
        </ul>
        
        <div class="clearBoth"></div>
         <?php if(isset($Product_Home_HN)  && is_array($Product_Home_HN) && count($Product_Home_HN) >= 1) echo '<a id="view_more_hn" style="font-size: 18px;color: #4895B9;cursor: pointer;float: right;">'.__('See more').'</a>';?>
        <div class="clearBoth"></div>
        <!-- END products in HANOI -->
    </div>
</div>
<!------------------------------ end body ------------------------------------->
<script>
    $(document).ready(function() {
        $("#list_feature li").popover({
            html : true, 
            title: function() {
              return $(this).find(".title_popover").html();
            },
            content: function() {
              return $(this).find(".content_popover").html();
            },
            width: 500
        });

        $("#view_more").click(function(){
            var count_product = $("#list_product_hcm li").size();
            $.ajax({
                url: '<?php echo $this->Html->url('/Home/addproductajax')?>',
                data: {'count':count_product,'location':1},
                type: 'post',
                dataType: 'html',
                success: function(data){
                    $("#list_product_hcm").append(data);
                }
            });
        });
        $("#view_more_hn").click(function(){
            var count_product = $("#list_product_hn li").size();
            $.ajax({
                url: '<?php echo $this->Html->url('/Home/addproductajax')?>',
                data: {'count':count_product,'location':2},
                type: 'post',
                dataType: 'html',
                success: function(data){
                    $("#list_product_hn").append(data);
                }
            });
        });
    });
</script>

